package com.tarena.lbs.activity.api.controller;
import com.tarena.lbs.activity.api.service.ActivityApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/activity")
public class ActivityApiController {

    // 注入接口，而非实现类，符合面向接口编程
    @Autowired
    private ActivityApiService activityApiService;

    @GetMapping("/check/{activityId}/{userId}")
    public boolean checkUserInActivity(
            @PathVariable Long activityId,
            @PathVariable Long userId) {
        return activityApiService.checkUserInActivity(activityId, userId);
    }
}
